package xq.gwt.ui.crud;

import java.util.HashMap;
import xq.gwt.mvc.model.ListItem;
import xq.gwt.mvc.model.PersistableEntityModel;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("persistance")
public interface PersistanceService extends RemoteService {
	public PersistableEntityModel persistEntity(PersistableEntityModel entity) throws Exception;
	public boolean deleteEntity(PersistableEntityModel entity) throws Exception;
	public void deleteAll(PersistableEntityModel entity) throws Exception;
	public PersistableEntityModel[] fetchAll(PersistableEntityModel entity) throws Exception;
	@Deprecated
	public FetchedEntities fetch(PersistableEntityModel entity, FilterModel filter) throws Exception; 
	@Deprecated
	public FetchedEntities fetch(PersistableEntityModel entity, FilterModel filter, OrderByModel[] orderBy) throws Exception;
	@Deprecated
	public FetchedEntities fetch(PersistableEntityModel entity, FilterModel filter, Integer offset, Integer maxRowCount) throws Exception;
	public FetchedEntities fetch(PersistableEntityModel entity, FilterModel filter, OrderByModel[] orderBy, Integer offset, Integer maxRowCount) throws Exception;
	public PersistableEntityModel fetchEntity(PersistableEntityModel entity) throws Exception;
	public HashMap<String, ListItem[]> fetchEntityListItems(PersistableEntityModel entity) throws Exception;
}

